# encoding: utf-8
from flask import jsonify
from flask_login import current_user

def login_required(func):
    def inner(*args, **kwargs):
        # 判断用户是否登录
        if current_user.is_authenticated:
            return func(*args)
        else:
            return jsonify({"code": 1001, "errorMsg": "请重新登录！"})
    return inner




